﻿ 
using NurseStation.common;
using NurseStation.viewmodels;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
 
namespace NurseStation.views
{
    /// <summary>
    /// BatchVitalSign.xaml 的交互逻辑
    /// </summary>
    public partial class BatchVitalSignView : UserControl
    {
        BatchVitalSignViewModel VMmodel;
        public BatchVitalSignView(BatchVitalSignViewModel model)
        {
            InitializeComponent();
            model.MainGrid = NursingRecordtMainGrid;
            VMmodel = model; 
            this.DataContext = VMmodel; 
        }

        ///// <summary>
        ///// 重写自定义UI渲染函数  2023-05-23
        ///// </summary>
        ///// <param name="drawingContext"></param>
        //protected override void OnRender(DrawingContext drawingContext)
        //{
        //    base.OnRender(drawingContext);
        //    #region 查找DataGrid
        //    if (NursingRecordtMainGrid != null)
        //    {
        //        var regTxtList = MyVisualTreeHelper.FindVisualChildren<DataGrid>(NursingRecordtMainGrid).ToList();
        //        if (regTxtList != null && regTxtList.Count() > 0)
        //        {
        //            if (VMmodel.dataGrid == null)
        //            {
        //                VMmodel.dataGrid = regTxtList[0];
        //                VMmodel.Init(null);
        //            }
        //        }
        //    }
        //    #endregion
        //}
    }
}
